﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameSquares
{
   public class Levels
    {
        public int Number { get; set; }

        public void ShowGraphItems(List<GraphItem> VisibleGI, int num, Random ran)
        {
            for (int i = 0; i < num; i++)
            {
                int r = ran.Next(VisibleGI.Count);
                if (VisibleGI[r].Ingame == true)
                    r = ran.Next(VisibleGI.Count);
                // робим рандом квадрат Ingame
                int count = 0;
                while (count < VisibleGI.Count)
                {
                    r++;
                    if (r == VisibleGI.Count)
                        r = 0;
                    count++;
                }
                if (Number == 0)
                {
                    VisibleGI[r].Visible = false;
                }
                if (Number == 1)
                {
                    VisibleGI[r].Active = true;
                    VisibleGI[r].Visible = true;
                }
                if (Number == 2)
                {
                    VisibleGI[r].Vanish = true;
                    VisibleGI[r].Visible = false;
                }
                VisibleGI[r].Ingame = true;
            }       
        }
    }
}
